class Solution
{
public:
    int minCostToMoveChips(vector<int> &position)
    {
        int evenCount = 0;
        int oddCount = 0;
        for (auto &pos : position)
        {
            if (pos & 1)
            {
                ++oddCount;
            }
            else
            {
                ++evenCount;
            }
        }
        return min(oddCount, evenCount);
    }
};